<?php
namespace app\admin\model;

class website extends \app\base\model\BaseModel{
	protected $table = 'website';

    //列表
    public function _select(){
        return $this->select();
    }

    //单个
    public function _find($condition){
        return $this->where($condition)->find();
    }

    //站点名称
    public function sitename($website_id){
        $rel = $this->where(array('id' =>$website_id))->find();
        return $rel['title'];
    }

    //删除
    public function _delete($condition){
        return $this->where($condition)->delete();
    }  

    //编辑
    public function _update($data,$condition = NULL){
        if($condition){
            return $this->where($condition)->data($data)->update();
        }else{
            return $this->data($data)->insert();
        }
    }  
}